import { Http } from '@/network/request'
import { DictDataDTO, DictDataVO, DictDTO, DictVO } from './data'

export const getDictsApi = (dto: DictDTO.Get) => {
  return Http.post<DictDTO.Get, DictVO.Get>('/sys-dict-type/list', dto)
}

export const putDictApi = (dto: DictDTO.Put) => {
  return Http.post<DictDTO.Put, true>('/sys-dict-type/saveOrUpdate', dto)
}

export const deleteDictsApi = (dto: DictDTO.Delete) => {
  return Http.post<DictDTO.Delete, true>('/sys-dict-type/removeBatchByIds', dto)
}

export const getDictDataApi = (dto: DictDataDTO.Get) => {
  return Http.post<DictDataDTO.Get, DictDataVO.Get>('/sys-dict-data/list', dto)
}

export const putDictDataApi = (dto: DictDataDTO.Put) => {
  return Http.post<DictDataDTO.Put, true>('/sys-dict-data/saveOrUpdate', dto)
}

export const deleteDictDataApi = (dto: DictDataDTO.Delete) => {
  return Http.post<DictDataDTO.Delete, true>('/sys-dict-data/removeBatchByIds', dto)
}
